<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\ProductSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '商品列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php Pjax::begin(); ?>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>


    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
//            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'ttid',
            'name',
            'price',
            'newprice',
            ['attribute'=>'image','value'=>function($model){
                return Html::img($model->image,['width'=>'50px']);
            },'format'=>'raw'],
            //'coupon_id',
            //'remark:ntext',
            'activity_id',

            ['class' => 'yii\grid\ActionColumn','template'=>"{view}{delete}"],
        ],
    ]); ?>
    <?php Pjax::end(); ?>
</div>
